home *** CD-ROM | disk | FTP | other *** search
/ Trading on the Edge / Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin / pc / mac_file / vendor_d / neuralwa / nw2v50 / backprop.nnc < prev    next >
Text File  |  1993-08-23  |  2KB  |  54 lines

  1. csv3.1        !file format is Control Strategy Version 3.1
  2. !************************************************************************
  3. !*                                    *
  4. !*    Back Propagation Network Control Strategy            *
  5. !*                                    *
  6. !************************************************************************
  7. !
  8. !MASK     label    op-code    operands    comment
  9. L_saR_sa    trace    aux3        ! set trace option to aux3
  10. L_saR_sa    optclr    op:bknc        ! do not BKp to PEs w/o conns
  11. Li_aR_sa    cset    recall,0    ! recall count
  12. !
  13. ! Get input (learn and recall) and desired output (learn only)
  14. !
  15. L_saR_sa    lset    in        ! input layer
  16. L___R_sa    io    read        ! get input data (recall)
  17. L_saR___    io    lrnin        ! get input data (learn)
  18. !
  19. ! Start with the first layer for a forward pass through network
  20. !
  21. L_saR_sa    lset    in        ! input layer
  22. ! Do summation separately to allow projective layers, and recurrence
  23. L_saR_sa @rloop math    sum|fire
  24. L___R_sa    math    rnoise|tran|output|e=0
  25. L_saR___    math    lnoise|tran|output|e=0|fire
  26. L_saR_sa    lset    cur,1        ! next layer
  27. L_saR_sa    lcmp    out        ! at output layer ?
  28. L_saR_sa    blt    @rloop        ! loop till done
  29. !
  30. ! We are now at the output layer.
  31. !
  32. ! Compute final outputs
  33. L___R_sa     math    sum|rnoise|tran|output|fire
  34. L___R_sa    io    write
  35. L_saR___     math    sum|lnoise|tran|output|fire
  36. L_saR___    io    lrnrslt
  37. !
  38. ! Get desired output and compute error
  39. L___R_sa    io    rcltst        ! get desired output (test)
  40. L___R_sa    math    e-=w
  41. L___R_sa    math    ce=e        ! current error for instruments
  42. L_saR___    io    lrnout        ! get desired output (learn)
  43. L_saR___    math    e-=w|e*=ef|fire
  44. !
  45. ! Learn cycle - back propagate error.  Store unscaled error in
  46. ! current error field.
  47. !
  48. L_saR___ @lloop    math    ce=e|e*=f'|backp|fire
  49. L_saR___     math    learn|fire    ! delayed learning for recurrence
  50. L_saR___    lset    cur,-1        ! previous layer
  51. L_saR___    lcmp    in        ! at input layer ?
  52. L_saR___    bgt    @lloop        ! loop till done
  53. LisaRisa    trace    0        ! turn off any trace function
  54.